<?php
  require_once('tpl/header.php');
require_once("../system/loginCheck.php");
require_once('../system/dbConn.php');
connect();
?>
<?php 
        //接收videolist传递的uid参数，连接数据库写sql语句去删除用户记录
        $vid = $_GET["vid"];
        $sql0="select  pic from videos where vid=$vid";
        $result0=mysql_query($sql0);
        $row0=mysql_fetch_assoc($result0);
        $filepath = "./posters/".$row0["pic"];
        if (file_exists($filepath)) {
            unlink($filepath);
        }
        //删除记录
        $sql = "delete  from videos where vid = $vid";
        $result = mysql_query($sql);
        if ($result == 1) {
            echo "删除成功,3秒后返回";
            header("refresh:3;url='videoList.php'");
        }
        else{
            echo "删除失败";
        }
     ?>




<?php
  require_once('tpl/footer.php');
?>